/**
 * 生成指定位置与边长的立方体坐标点数组
 * @param {{x: number, y: number, z: number}} A 观察点
 * @param {{x: number, y: number, z: number}} c 立方体中心点坐标
 * @param {number} sl 立方体边长
 */
const getCube = (A, c, sl) => {
  let hsl = sl / 2;
  let ABCD = [
    { x: c.x - hsl, y: c.y - hsl, z: c.z + hsl },
    { x: c.x - hsl, y: c.y - hsl, z: c.z - hsl },
    { x: c.x + hsl, y: c.y - hsl, z: c.z - hsl },
    { x: c.x + hsl, y: c.y - hsl, z: c.z + hsl }
  ];
  let EFGH = ABCD.map(v => Object.assign({}, v, { y: v.y + sl }));
  return [...ABCD, ...EFGH];
}